package com.wonders.frame.repository;

import com.wonders.frame.entity.AuthDic;
import com.wonders.frame.entity.AuthPermission;
import com.wonders.frame.repository.core.CoreRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AuthPermissionRepository extends CoreRepository<AuthPermission> {

     AuthPermission findAllById(String Id);

     List<AuthPermission> findByRemovedOrRemovedNull(Integer removed);


     List<AuthPermission> findByParentIdAndRemoved(String parentId, Integer removed);

     List<AuthPermission> findByComponentTextLike(String Component_text);

     @Query("select d from AuthPermission d where code=:code and removed=:removed")
     List<AuthPermission> findByCodeAndRemoved(@Param("code") String code , @Param("removed") Integer removed);

}
